#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtNetwork/QNetworkReply>
#include <QWaitCondition>
#include <QMutex>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_btnStart_clicked();

    void on_btnStop_clicked();

    void on_cbxPixel_currentIndexChanged(int index);

private:
    void readyRead();
    void ParseFrame(const QByteArray &vBuf);
    void RequestStatus();
    QByteArray m_buffer;
    QNetworkReply *m_pvClient = nullptr;
    QWaitCondition m_condition;
    QMutex m_mutex;


private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
